# -*- coding:utf-8 -*- 

from xmlrpclib import Fault

# defines the fault code

SUCCESS_BASE = 2120
PERMISSION = SUCCESS_BASE + 1

FAULT_BASE = 2520
SESSION_ALREADY_EXISTS = FAULT_BASE + 1
SESSION_INVAID = FAULT_BASE + 2
DENIE = FAULT_BASE + 3


class SessionExistsError(Fault):
    """
    An exception that represents an unhandled query.
    """
    def __init__(self, message="this session has already joined"):
        Fault.__init__(self, SESSION_ALREADY_EXISTS, message)
        
        
class SessionInvalidError(Fault):
    """
    An exception that represents an unhandled query.
    """
    def __init__(self, message="this session is invalid"):
        Fault.__init__(self, SESSION_INVAID, message)